<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
  <th:block th:include="include :: header('批量延期审核M')"/>
  <link th:href="@{/ajax/libs/bootstrap-switch/bootstrap-switch.min.css}" rel="stylesheet">
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
  <form class="form-horizontal m" id="form-config-add" name="form-config-add">
    <input type="hidden" name="ids" th:value="${ids}"/>
    <div class="col-sm-12">
      <div class="form-group">
        <label class="col-xs-3 control-label-new" style="color: red">审核意见：</label>
        <div class="col-xs-9">
          <select id="txtchkDesc" onchange="dropChgSendTextOnly(this,'chkDesc');"
                  class="form-control m-b phoneCategory">
            <option value="">-请选择-</option>
            <option value="10">描述不详细</option>
            <option value="20">理由不充分</option>
            <option value="99">其他</option>
          </select>
          <textarea id="chkDesc" name="chkDesc" maxlength="3500"
                    class="form-control opinion"
                    rows="3"
                    style="height: 130px"></textarea>
        </div>
      </div>
    </div>
    <div class="col-sm-12">
      <div class="form-group">
        <label class="col-xs-2 control-label-new" style="color: red">审核备注：</label>
        <div class="col-xs-3">
                        <textarea name="chkRemark" maxlength="3500"
                                  class="form-control opinion"
                                  rows="3"
                                  style="height: 130px"></textarea>
        </div>
      </div>
    </div>
    <!--按钮-->
    <div class="col-sm-12" style="display: flex;justify-content: space-around;margin-bottom: 10px;">
      <div class="col-sm-4" style="display: flex;justify-content: space-evenly;">
        <button type="button" class="btn btn-info" onclick="btnChkClick(21)">同意</button>
        <button type="button" class="btn btn-success" onclick="btnChkClick(22)">不同意</button>
        <button type="button" class="btn btn-light" onclick="$.modal.close()">关闭</button>
        <input type="hidden" name="deferState" id="deferState">
      </div>
    </div>
  </form>
</div>
<th:block th:include="include :: footer"/>
<script th:src="@{/ajax/libs/bootstrap-switch/bootstrap-switch.min.js}"></script>
<script type="text/javascript">
  var prefix = ctx + "system/mInterior/cmnFile";

  $("#form-config-add").validate({
    onkeyup: false,
    focusCleanup: true
  });

  $(function () {
    $('#checkTime').val(DateToStr());
  })

  function btnChkClick(flag) {
    var text = $('#txtchkDesc option:selected').text();
    if (flag == 21) {
      if (text != null && text != '') {
        $('#chkDesc').val(text);
      }else {
        $('#chkDesc').val("同意");
      }
    } else {
      if (text != null && text != '') {
        $('#chkDesc').val(text);
      }else {
        $('#chkDesc').val("不同意");
      }
    }
    $('#deferState').val(flag);
    if ($.validate.form()) {
      let data = $('#form-config-add').serializeArray();
      $.operate.save(prefix + "/mDeferBatchCheckJson", data);
    }
  }

</script>
</body>
</html>
